package com.difsonapps.contacttranslator.service.impl;

import java.util.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.difsonapps.contacttranslator.dao.NumberDAO;
import com.difsonapps.contacttranslator.dto.NumberDTO;
import com.difsonapps.contacttranslator.service.itf.NumberService;

@Repository
@Transactional
public class NumberServiceImpl implements NumberService {
	@Autowired
	protected NumberDAO numberDAO;

	@Transactional
	public void insert(NumberDTO numberDTO) {
		numberDAO.insert(numberDTO);
	}

	@Transactional
	public void update(NumberDTO numberDTO) {
		numberDAO.update(numberDTO);
	}

	@Transactional
	public NumberDTO get(int id) {
		return numberDAO.get(id);
	}

	@SuppressWarnings("unchecked")
	@Transactional
	public List<NumberDTO> getAll() {
		return numberDAO.getAll();
	}

	@Transactional
	public void delete(NumberDTO numberDTO) {
		numberDAO.delete(numberDTO);
	}
}
